//package com.mo.tools.config.sharding;
//
//import com.yuntu.edos.utils.DataMonthComplexUtils;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.shardingsphere.sharding.api.sharding.complex.ComplexKeysShardingAlgorithm;
//import org.apache.shardingsphere.sharding.api.sharding.complex.ComplexKeysShardingValue;
//import org.springframework.stereotype.Component;
//
//import java.util.Collection;
//import java.util.Properties;
//import java.util.stream.Collectors;
//
///**
// * 年月复核*
// */
//@Component
//@Slf4j
//public class DataMonthComplexKeyShardingAlgorithm implements ComplexKeysShardingAlgorithm<Comparable<?>> {
//    private Properties props;
//    @Override
//    public Collection<String> doSharding(Collection collection, ComplexKeysShardingValue complexKeysShardingValue) {
//        return DataMonthComplexUtils.getTableNames(collection,complexKeysShardingValue).stream().distinct().collect(Collectors.toList());
//    }
//
//    @Override
//    public void init(Properties properties) {
//        this.props = properties;
//    }
//
//    /**
//     * SPI方式的 SPI名称，配置文件中配置的时候需要用到
//     */
//    @Override
//    public String getType() {
//        return "TimeIdAlgorithm";
//    }
//
//    @Override
//    public Properties getProps() {
//        return this.props;
//    }
//}